package net.daum.webtoon.android;

import org.json.JSONObject;

import net.daum.webtoon.android.dto.DTO_WebToon;
import net.daum.webtoon.android.io.DaumWebToonsSelectedTask;
import net.daum.webtoon.android.util.Logger;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;

import com.example.android.actionbarcompat.BaseActionBarActivity;

public class WebToonSelectedListActivity extends BaseActionBarActivity {

	private static final String TAG = WebToonSelectedListActivity.class
			.getSimpleName();
	private DTO_WebToon mWebToont;
	private ListView mWebToonListView;
	private Context mContext;

	private DaumWebToonsSelectedTask daumWebToonsSelectedTask;
	private Handler mHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 0:

				break;

			default:
				break;
			}
		}
	};
	JSONObject mJsonObject;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = WebToonSelectedListActivity.this;
		setContentView(R.layout.actvity_web_toon_selected);
		mWebToonListView = (ListView) findViewById(R.id.lv_web_toon);
		try {
			mWebToont = (DTO_WebToon) getIntent().getSerializableExtra("data");
			setTitle(mWebToont.title);
			daumWebToonsSelectedTask = new DaumWebToonsSelectedTask(mContext,
					mWebToont.nickname, 1, 10, run);
			daumWebToonsSelectedTask.execute(mJsonObject);
		} catch (Exception e) {
			Logger.e(TAG, e.getMessage(), e);
		}
	}

	@Override
	public void onHomeSelected() {

	}

	@Override
	public void onRefreshSelected(Runnable runnable) {

	}

	@Override
	public void onSearchSelected() {

	}

	@Override
	public void onShareSelected() {

	}

	private Runnable run = new Runnable() {

		@Override
		public void run() {
			mHandler.sendEmptyMessage(0);
		}
	};

	private class WebToonListAdapter extends BaseAdapter {

		public WebToonListAdapter() {
			// TODO Auto-generated constructor stub
		}

		@Override
		public int getCount() {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public Object getItem(int position) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public long getItemId(int position) {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			// TODO Auto-generated method stub
			return null;
		}

	}

}
